package com.github.caijinglong.handler

import com.github.caijinglong.SaveDataGetter
import com.github.caijinglong.SaveDataHandler
import com.github.caijinglong.SavedDataType
import com.github.caijinglong.ext.println
import com.github.caijinglong.getGetter
import org.json.JSONArray
import org.json.JSONObject

class PlayedTimeHandler : SaveDataHandler {
    override var jsonObject: JSONObject = JSONObject()

    fun handleTime(time: Long) {
        jsonObject.put("play_time", time)
    }

    companion object {

        @JvmStatic
        fun main(args: Array<String>) {
            PlayedTimeHandler().apply {
                bind(SavedDataType.ZS.getGetter())
                handleTime(1)
                save(SavedDataType.ZS.srcPath)
            }
        }
    }
}